package top.glike.ssl.auto.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import top.glike.ssl.common.annotation.Excel;
import top.glike.ssl.common.core.domain.BaseEntity;

import java.util.Date;

/**
 * 服务器管理对象 ssl_server
 *
 * @author Sophia
 * @date 2025-10-12
 */
public class SslServer extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    private Long id;

    /**
     * 服务器名称
     */
    @Excel(name = "服务器名称")
    private String name;

    /**
     * 服务器IP地址
     */
    @Excel(name = "服务器IP地址")
    private String ipAddress;

    /**
     * SSH端口
     */
    @Excel(name = "SSH端口")
    private Long sshPort;

    /**
     * 登录用户名
     */
    @Excel(name = "登录用户名")
    private String username;

    /**
     * 登录密码
     */
    @Excel(name = "登录密码")
    private String password;

    /**
     * SSH私钥
     */
    @Excel(name = "SSH私钥")
    private String privateKey;

    /**
     * 认证方式
     */
    @Excel(name = "认证方式")
    private String authType;

    /**
     * Nginx配置目录
     */
    @Excel(name = "Nginx配置目录")
    private String nginxConfigPath;

    /**
     * 证书存储基础路径
     */
    @Excel(name = "证书存储基础路径")
    private String certBasePath;

    /**
     * Nginx重载命令
     */
    @Excel(name = "Nginx重载命令")
    private String nginxReloadCmd;

    /**
     * 状态:1启用,0禁用
     */
    @Excel(name = "状态:1启用,0禁用")
    private Integer status;

    /**
     * 健康状态:1正常,0异常
     */
    @Excel(name = "健康状态:1正常,0异常")
    private Integer healthStatus;

    /**
     * 最后健康检查时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后健康检查时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastHealthCheck;

    /**
     * 描述
     */
    @Excel(name = "描述")
    private String description;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public Long getSshPort() {
        return sshPort;
    }

    public void setSshPort(Long sshPort) {
        this.sshPort = sshPort;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPrivateKey() {
        return privateKey;
    }

    public void setPrivateKey(String privateKey) {
        this.privateKey = privateKey;
    }

    public String getAuthType() {
        return authType;
    }

    public void setAuthType(String authType) {
        this.authType = authType;
    }

    public String getNginxConfigPath() {
        return nginxConfigPath;
    }

    public void setNginxConfigPath(String nginxConfigPath) {
        this.nginxConfigPath = nginxConfigPath;
    }

    public String getCertBasePath() {
        return certBasePath;
    }

    public void setCertBasePath(String certBasePath) {
        this.certBasePath = certBasePath;
    }

    public String getNginxReloadCmd() {
        return nginxReloadCmd;
    }

    public void setNginxReloadCmd(String nginxReloadCmd) {
        this.nginxReloadCmd = nginxReloadCmd;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getHealthStatus() {
        return healthStatus;
    }

    public void setHealthStatus(Integer healthStatus) {
        this.healthStatus = healthStatus;
    }

    public Date getLastHealthCheck() {
        return lastHealthCheck;
    }

    public void setLastHealthCheck(Date lastHealthCheck) {
        this.lastHealthCheck = lastHealthCheck;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("name", getName())
                .append("ipAddress", getIpAddress())
                .append("sshPort", getSshPort())
                .append("username", getUsername())
                .append("password", getPassword())
                .append("privateKey", getPrivateKey())
                .append("authType", getAuthType())
                .append("nginxConfigPath", getNginxConfigPath())
                .append("certBasePath", getCertBasePath())
                .append("nginxReloadCmd", getNginxReloadCmd())
                .append("status", getStatus())
                .append("healthStatus", getHealthStatus())
                .append("lastHealthCheck", getLastHealthCheck())
                .append("description", getDescription())
                .append("createdTime", getCreatedTime())
                .append("updatedTime", getUpdatedTime())
                .toString();
    }
}
